<h1>Vos Commandes</h1>
<hr/>
<table id="table_commande">
  <thead>
    <tr>
    	<th class="align_center">Date</th>
    	<th class="align_center">Numéro de Commande</th>
		<th class="align_center">Statut</th>
     	<th class="align_center">Date expedition</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($commande_list as $commande): ?>
    <tr>
      <td class="align_center">
	      <?php
		      $array_date_mysql = explode(" ", $commande->getDateCreation());
		      echo $array_date_mysql[0];
	      ?>
	  </td>
      <td class="align_center">
      		<a href="<?php echo url_for('commande/show?id='.$commande->getId()) ?>">
      			<?php
      				$array_date_mysql = explode(" ", $commande->getDateCreation());
      				$array_date_mysql = explode("-", $array_date_mysql[0]);
      				
      				echo "COM".$array_date_mysql[0].$array_date_mysql[1].$array_date_mysql[2]."-".$commande->getId();
      			?>
      		</a>
      </td>
      <td class="align_center">
      		<?php
      			if($commande->getStatut() != NULL)
      			{
      				echo $commande->getStatut();
      			}
      			else
      			{
      				echo "--";
      			}      		
      		?>
      </td>
      <td class="align_center">
			<?php
			     $array_date_mysql = explode(" ", $commande->getDateExpedition());
			     echo $array_date_mysql[0];
		    ?>
	 </td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>

